import express, { Router } from 'express'
import { authGuard } from '../auth/auth.middleware'
import { fileInterceptor, fileProcessor } from './file.middleware'
import * as fileController from './file.controller'

const router: Router = express.Router()

router.post(
  '/upload',
  authGuard,
  fileInterceptor,
  fileProcessor,
  fileController.store
)

router.get('/file/:fileId', fileController.serve)
router.get('/file/:fileId/meta', fileController.metaData)

export default router
